import {View} from '@tarojs/components'

import './index.scss'
import BannerSwiper from "@/pages/tabbar/home/components/BannerSwiper";
import {useEffect, useState} from "react";
import BannerGrid from "@/pages/tabbar/home/components/BannerGrid";
import BannerActivity from "src/pages/tabbar/home/components/BannerActivity";

export default function Index() {
  const [bannerList, setBannerList] = useState<string[]>([]);

  useEffect(() => {
    const list = [
      "https://njg-1360428576.cos.ap-chengdu.myqcloud.com/jms/0636cb3e-d8fd-40e5-92e2-fae6c5392306.jpg",
      "https://njg-1360428576.cos.ap-chengdu.myqcloud.com/JMS/bbbecfa1-ca9c-4bf5-a15a-b482e8850f29.jpg",
      "https://njg-1360428576.cos.ap-chengdu.myqcloud.com/JMS/82fd84ce-1315-4acb-b2e7-9444b61b7624.jpg",
    ];
    setBannerList(list);
  }, []);

  return (
    <View className="index-page">
      {/*首页轮播图*/}
      <BannerSwiper banners={bannerList}/>
      {/*首页宫格*/}
      <BannerGrid/>
      {/*首页活动*/}
      <BannerActivity/>
    </View>
  )
}
